﻿<?php
	require('database/connection.php');
	session_start();
	ob_start();
	if(!empty($_GET['mod'])){
		$mod=$_GET['mod'];
}else $mod = '';
	
	if($mod==''||!isset($_SESSION['admin_id']))$mod='dangnhap';
	
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Dashboard - Admin Template</title>
<link rel="stylesheet" type="text/css" href="admin/css/theme1.css" />
<link rel="stylesheet" type="text/css" href="admin/css/style.css" />
<script>
function setCookie(c_name,value,exdays)
{
    var exdate=new Date();
exdate.setDate(exdate.getDate() + exdays);
var c_value=escape(value) + ((exdays==null) ? "" : "; expires="+exdate.toUTCString());
document.cookie=c_name + "=" + c_value;
}

function getCookie(c_name)
{
var i,x,y,ARRcookies=document.cookie.split(";");
for (i=0;i<ARRcookies.length;i++)
{
  x=ARRcookies[i].substr(0,ARRcookies[i].indexOf("="));
  y=ARRcookies[i].substr(ARRcookies[i].indexOf("=")+1);
  x=x.replace(/^\s+|\s+$/g,"");
  if (x==c_name)
    {
    return unescape(y);
    }
  }
}
   var theme=getCookie('admintheme');
   document.writeln('<link rel="stylesheet" type="text/css" href="admin/css/theme' + theme + '.css">');
</script>
<!--[if IE]>
<link rel="stylesheet" type="text/css" href="css/ie-sucks.css" />
<![endif]-->
</head>

<body>
	<div id="container">
    
    <!--menu-->
    <div id="header">
        	<h2>TRANG QUẢN TRỊ APP STORE</h2>
    <div id="topmenu">
            	<ul>
              
                    <li><a href="index.php">TRANG CHỦ</a></li>
                    <?php
                        if(isset($_SESSION['admin_id']))
						{
                    ?>
                        <li <?php if(strpos($mod,'app')!==false) echo 'class="current"' ?>><a href="?mod=app">APP</a></li>
                        <li <?php if(strpos($mod,'category')!==false) echo 'class="current"' ?>><a href="?mod=category">CATEGORY</a></li>
                        <li <?php if(strpos($mod,'user')!==false) echo 'class="current"' ?>><a href="?mod=user">USER</a></li>
                        <li <?php if(strpos($mod,'log')!==false) echo 'class="current"' ?>><a href="?mod=log">USER LOG</a></li>
                        <li <?php if(strpos($mod,'dangxuat')!==false) echo 'class="current"' ?>><a href="?mod=dangxuat">Log Out</a></li>
					<?php
                        }
                    ?>
           	  </ul>
    </div>
</div>
    <!--//menu-->
	
            <div id="content">
			<?php
				include("admin/modules/$mod.php");
			?>
          	</div>
     
	 <!--footer-->
     <div id="footer">
        <div id="styleswitcher">
            <ul>
                <li><a href="javascript:setCookie('admintheme',5,7); window.location.reload();" title="Default" id="defswitch">d</a></li>
                <li><a href="javascript:setCookie('admintheme',1,7); window.location.reload();" title="Blue" id="blueswitch">b</a>

                    <li><a href="javascript:setCookie('admintheme',2,7); window.location.reload();" title="Green" id="greenswitch">g</a></li>
                </li>
                <li><a href="javascript:setCookie('admintheme',3,7); window.location.reload();" title="Brown" id="brownswitch">b</a></li>
                <li><a href="javascript:setCookie('admintheme',4,7); window.location.reload();" title="Mix" id="mixswitch">m</a></li>
            </ul>
        </div>

 </div>
     <!--//footer-->
</div>
</body>
</html>
